//
//  ViewController.m
//  UseBlock
//
//  Created by liy on 2024/12/19.
//

#import "HttpTool.h"
#import "ViewController.h"

@interface ViewController ()
@property (nonatomic, strong) HttpTool *tools;

@end

@implementation ViewController

- (void)viewDidLoad {
  [super viewDidLoad];

  self.tools = [[HttpTool alloc]init];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
  __weak ViewController *weakSelf = self;

  [self.tools loadData:^(NSString *_Nonnull jsonData) {
    NSLog(@"拿到了数据：%@", jsonData);
    weakSelf.view.backgroundColor = [UIColor redColor];
  }];
}

- (void)dealloc
{
  NSLog(@"---ViewController销毁");
}

@end
